#ifndef __SWARMTASK_H__
#define __SWARMTASK_H__

#include "../support/Timing.hpp"
#include "Externs.hpp"

#include "../common/Runnable.hpp"

#include <iostream>

template <int TASK_ID, int NPARAMS, int TASKTAGDIM, int INTERTASKDIM>
class SWARMTask : public Runnable {
  const int id = TASK_ID;

  void *arrayPtr;
  std::array<int64_t, NPARAMS> params;

public:
  template <typename... Sizes> 
  SWARMTask(void *a, Sizes... sizes) : arrayPtr(a), params{{std::forward<Sizes>(sizes)...}} {
    static_assert(NPARAMS == sizeof...(Sizes), "ERROR");
    assert(arrayPtr != nullptr);
  }

  void operator()();

protected:
  // Virtual 
  void print(ostream &os) {
    os << "SWARM version";
  }
};

#include "SWARMTaskTag.hpp"
#include "SWARMTaskTagWrapper.hpp"
#endif // __SWARMTASK_H__
